﻿@model Zor_Web.Models.Base.V_Zor_InputJinSan
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>金三录入</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!-- 日期选择器 -->
    <script src="~/Content/LayerUI/src/layui.js"></script>    
</head>
<body>
    <div class="layui-tab layui-tab-brief main-tab-container ">
       <div class="col-sm-12 ct-padding">                                   
        <button id="btnAdd" class="layui-btn layui-btn layui-btn-small"><span class="glyphicon glyphicon-plus"></span> 新增 </button>
        <button id="btnSearch" class="layui-btn  layui-btn-normal layui-btn-small"><span class="glyphicon glyphicon-search"></span>查询</button>
           <button id="btnFeesDetails" class="layui-btn  layui-btn-orchid layui-btn-small"><span class="glyphicon glyphicon-list-alt"></span> 详情 </button>
        <button id="btnReplace" class="layui-btn layui-btn-blue layui-btn-small"> <span class="glyphicon glyphicon-refresh"></span>刷新</button>
    </div>         
        <div class="layui-tab-content">
            <table class="layui-table" lay-skin="line">
                <thead>
                    <tr>
                        <th hidden></th>
                        <th></th>
                        <th>受理单号</th>
                        <th>付款人</th>
                        <th>纳税人</th>
                        <th>房屋面积</th>
                        <th>房屋租金(元)</th>
                        <th>联系方式</th>
                        <th>税金(元)</th>
                        <th>操作时间</th>
                        <th>操作人</th>
                        <th>受理状态</th>
                    </tr>
                </thead>
                <tbody id="accordion">
                    @foreach (var item in Model.PageData)
                    {
                        <tr>
                            <td hidden>@item.Js_Id</td>
                            <td><input type="radio" name="chk" id="@item.Js_Id" value="@item.Js_Id" /></td>
                            <td>@item.Acceptance_TicketNumber</td><!--受理单号2-->
                            <td>@item.Tenant_Name</td><!--付款名称3-->
                            <td>@item.NatPer_Name</td><!--纳税人4-->
                            <td>@item.Hs_Proportion</td><!--房屋面积5-->
                            <td>@(item.Evaluate_Rent*0.01)</td><!--房屋租金6-->
                            <td>@item.NatPer_Phone</td><!--纳税人电话7-->
                            <td>@(item.Js_Tax*0.01)</td><!--金三税金8-->
                            <td>@TimeHelper.TimeStampToDateTime(item.Js_CreateDate.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                            <td>@item.User_Id</td><!--操作人ID10-->
                            @if (@item.JsState == "已保存")
                            {
                                <td style="color:red">@item.JsState</td>
                            }
                            else
                            {
                                 <td>@item.JsState</td><!--金三受理状态11-->
                            }                            
                            <td hidden>@item.Js_Increment</td><!--增值税12-->
                            <td hidden>@item.Js_HouseTax</td><!--房产税13-->
                            <td hidden>@item.Js_UrbanTax</td><!--城建税14-->
                            <td hidden>@item.Js_Education</td><!--附加教育税15-->
                            <td hidden>@item.Js_LocalEducation</td><!--地方附加教育税16-->
                            <td hidden>@item.Js_Stamp</td><!--印花税17-->
                            <td hidden>@item.Js_PersonTax</td><!--个人所得税18-->
                            <td hidden>@item.Js_WaterTax</td><!--水利基金税19-->
                            <td hidden>@item.Js_Zigui</td><!--字轨票号20-->                           
                            <td hidden>@item.Js_Dinvoice</td><!--发票票号21-->
                            <td hidden>@item.Examine_Id</td><!--审核管理ID22-->
                            <td hidden>@item.Acceptance_State</td><!--受理状态23-->
                            <td hidden>@item.Hs_Id</td><!--房屋ID24-->
                            <td hidden>@item.Uim_Id</td><!--单元ID25-->
                            <td hidden>@item.Bd_Id</td><!--楼宇ID26-->
                            <td hidden>@item.jdbId</td><!--街道办ID27-->
                            <td hidden>@item.sqId</td><!--社区ID28-->
                            <td hidden>@item.Js_State</td><!--金三状态29-->                           
                        </tr>
                    }
                </tbody>
            </table>
            <div class="row">
                <div class="col-sm-9">
                    @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "", @class = "pagination" })
                </div>
                <div class="col-sm-3">
                    共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                </div>
            </div>
        </div>
        
    </div>
    <!-- 模态:收费详情 -->
    <div id="FeesDetailsModal" hidden data-backdrop="static">
        <div id="divfrom" class="ibox float-e-margins">                 
            <div class="modal-body">
                <form class="form-horizontal m-t">                       
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">受理单号：</label>
                        <div class="col-sm-9 layui-input" id="AcceptanceTicketNumber"> </div>                                                       
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">纳税人姓名：</label>
                        <div class="col-sm-9 layui-input" id="NatPerName"></div>                                                          
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">付款方名称：</label>
                        <div id="TenantName" class="col-sm-9 layui-input"></div>
                    </div>                     
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">发票票号：</label>
                        <div class="col-sm-9 layui-input" id="Dinvoice"></div>                                                  
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">字轨票号：</label>
                        <div class="col-sm-9  layui-input" id="Zigui"></div>                                                  
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label" style="color:red;">开票税额合计(元)：</label>
                        <div class="col-sm-9  layui-input" id="JsTax" style="color:red;"></div>                                                   
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">增值税(元)：</label>
                        <div class="col-sm-3 layui-input" id="Increment"> </div>                                                 
                        <label class="col-sm-3 layui-form-label">房产税(元)：</label>
                        <div class="col-sm-3 layui-input" id="HouseTax"></div>                                                   
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">城建税(元)：</label>
                        <div class="col-sm-3 layui-input" id="UrbanTax"> </div>                                                 
                        <label class="col-sm-3 layui-form-label">教育附加税(元)：</label>
                        <div class="col-sm-3 layui-input" id="Education"></div>                                                   
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">地方教育附加税(元)：</label>
                        <div class="col-sm-3 layui-input" id="LocalEducation"> </div>                                                 
                        <label class="col-sm-3 layui-form-label">印花税(元)：</label>
                        <div class="col-sm-3 layui-input" id="Stamp"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="col-sm-3 layui-form-label">个人所得税(元)：</label>
                        <div class="col-sm-3 layui-input" id="PersonTax"></div>                                                  
                        <label class="col-sm-3 layui-form-label">水利基金税(元)：</label>
                        <div class="col-sm-3 layui-input" id="WaterTax"></div>                                                 
                    </div>                     
                       
                </form>                
            </div>          
        </div>
    </div>
    <!-- 模态:查询 -->
    @using (Html.BeginForm("Zor_InputJinSan", "Base", new RouteValueDictionary { { "Model", Model } }, FormMethod.Get))
    {
    <!--查询模态-->
     <div id="QueryModal" style="display: none;padding: 20px;">                   
        <form class="layui-form">
            <div class="layui-form-item" hidden>
                <label class="col-sm-3 layui-form-label">ID：</label>
                <div class="col-sm-9">
                    <input type="text" value="@Model.Js_Id" class="form-control">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">受理单号：</label>
                <div class="col-sm-9">
                    <input type="text" name="Acceptance_TicketNumber" value="@Model.Acceptance_TicketNumber" class="form-control">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">纳税人姓名：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="NatPer_Name" value="@Model.NatPer_Name">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">付款方名称：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="Tenant_Name" value="@Model.Tenant_Name">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">字轨票号：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" name="Js_Zigui" value="@Model.Js_Zigui">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">操作开始日：</label>
                <div class="col-sm-9">                            
                    <input class="layui-input startEndData" name="CreateStartTime" placeholder="开始日" data-type="开始日" id="startDate" value="@Model.CreateStartTime">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">操作截止日：</label>
                <div class="col-sm-9">                      
                    <input class="layui-input startEndData" name="CreateEndTime" placeholder="截止日" data-type="截止日" id="startDate" value="@Model.CreateEndTime">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="col-sm-3 layui-form-label">受理状态：</label>
                <div class="col-sm-9">
                    <select class="form-control" name="JsState">
                        <option value="全部" selected>全部</option>
                        <option value="@Model.JsState">已保存</option>
                        <option value="@Model.JsState">发票已出</option>
                        <option value="@Model.JsState">已销号</option>                      
                    </select>
                </div>
            </div>
        </form>
       <div class="box-footer">
        <button type="submit" id="btnQuery" class="btn btn-info pull-right">
            <i class="fa fa-search"></i>查询
        </button>
      </div>                      
   </div>
}
    <!-- 模态:添加 -->
    <div id="AddModal" style="display: none;padding: 20px;">
        <div class="layui-tab-content" style="overflow-y: auto;">
            <div id="divfrom" class=" layui-tab-content">
                <form class="form-horizontal m-t">
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">Js_Id：</label>
                        <div class="col-sm-9">
                            <input id="Js_Id" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">Hs_Id：</label>
                        <div class="col-sm-9">
                            <input id="Hs_Id" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">Uim_Id：</label>
                        <div class="col-sm-9">
                            <input id="Uim_Id" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">Bd_Id：</label>
                        <div class="col-sm-9">
                            <input id="Bd_Id" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">jdbId：</label>
                        <div class="col-sm-9">
                            <input id="jdbId" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label class="col-sm-3 control-label">sqId：</label>
                        <div class="col-sm-9">
                            <input id="sqId" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">受理单号：</label>
                        <div class="col-sm-3">
                            <input readonly id="Ap_TicketNumber" type="text" class="form-control">
                        </div>
                        <label class="col-sm-3 control-label">纳税人姓名：</label>
                        <div class="col-sm-3">
                            <input readonly class="form-control" id="T_Name">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">付款方名称：</label>
                        <div class="col-sm-9">
                            <input readonly class="form-control" id="N_Name">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">增值税(元)：</label>
                        <div class="col-sm-3">
                            <input id="Js_Increment" type="text" class="form-control" onblur="addJsTax()">
                        </div>
                        <label class="col-sm-3 control-label">房产税(元)：</label>
                        <div class="col-sm-3">
                            <input class="form-control" id="Js_HouseTax" onblur="addJsTax()">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">城建税(元)：</label>
                        <div class="col-sm-3">
                            <input id="Js_UrbanTax" type="text" class="form-control" onblur="addJsTax()">
                        </div>
                        <label class="col-sm-3 control-label">教育附加税(元)：</label>
                        <div class="col-sm-3">
                            <input class="form-control" id="Js_Education" onblur="addJsTax()">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">地方教育附加税(元)：</label>
                        <div class="col-sm-3">
                            <input id="Js_LocalEducation" type="text" class="form-control" onblur="addJsTax()">
                        </div>
                        <label class="col-sm-3 control-label">印花税(元)：</label>
                        <div class="col-sm-3">
                            <input class="form-control" id="Js_Stamp" onblur="addJsTax()">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">个人所得税(元)：</label>
                        <div class="col-sm-3">
                            <input id="Js_PersonTax" type="text" class="form-control" onblur="addJsTax()">
                        </div>
                        <label class="col-sm-3 control-label">水利基金税(元)：</label>
                        <div class="col-sm-3">
                            <input class="form-control" id="Js_WaterTax" onblur="addJsTax()">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label" style="color:red;">开票税额合计(元)：</label>
                        <div class="col-sm-9">
                            <input class="form-control" id="Js_Tax">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">完税证号：</label>
                        <div class="col-sm-9">
                            <input class="form-control" id="Js_CertificateNumber">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">发票票号：</label>

                        <div class="col-sm-4">
                            <input class="form-control" id="Js_Dinvoice">   <!--第一个发票输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInput"><i class="fa fa-plus"></i>添加</label>

                        <div class="col-sm-4">
                            <input class="form-control" id="JS_Dinvoice1" style="display:none"> <!--第二个发票输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInputfp1" style="display:none"><i class="fa fa-plus"></i>添加</label>

                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label"></label>
                        <div class="col-sm-4">
                            <input class="form-control" id="Js_Dinvoice2" style="display:none">  <!--第三个发票输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInputfp2" style="display:none"><i class="fa fa-plus"></i>添加</label>
                        <div class="col-sm-4">
                            <input class="form-control" id="JS_Dinvoice3" style="display:none">   <!--第四个发票输入框-->
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">字轨票号：</label>

                        <div class="col-sm-4">
                            <input id="Js_Zigui" type="text" class="form-control">  <!--第一个字轨输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInput1"><i class="fa fa-plus"></i>添加</label>

                        <div class="col-sm-4" id="demo">
                            <input class="form-control" id="JS_Zigui1" style="display:none"> <!--第二个字轨输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInputzg1" style="display:none"><i class="fa fa-plus"></i>添加</label>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label"></label>
                        <div class="col-sm-4">
                            <input class="form-control" id="JS_Zigui2" style="display:none"> <!--第三个字轨输入框-->
                        </div>
                        <label class="col-sm-1 control-label" id="addInputzg2" style="display:none"><i class="fa fa-plus"></i>添加</label>
                        <div class="col-sm-4" id="demo">
                            <input class="form-control" id="JS_Zigui3" style="display:none"> <!--第四个字轨输入框-->
                        </div>
                    </div>

                </form>
                <div class="box-footer">
                    <button type="submit" id="btnSure" class="btn btn-info pull-right">
                        <i class="fa fa-check"></i>提交
                    </button>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    /*
    **时间选择
    */
    layui.use(['element', 'layer', 'form', 'laydate'], function () {
        var element = layui.element(),
        jq = layui.jquery,
        form = layui.form(),
        laydate = layui.laydate;

        var start = {
            max: '2099-06-16 23:59:59',
            istoday: false,
            choose: function (datas) {
              end.min = datas;     //开始日选好后，重置结束日的最小日期
              end.start = datas    //将结束日的初始值设定为开始日
          }
        };

        var end = {
            max: '2099-06-16 23:59:59',
            istoday: false,
            choose: function (datas) { start.max = datas; }  //结束日选好后，重置开始日的最大日期        
        };
        jq('.startEndData').on('click', function () {
            var type = jq(this).data('type');
            if (type == "开始日") {
                start.elem = this;
                laydate(start);
            }
            else {
                end.elem = this
                laydate(end);
            }
        })
    })

    /**
    *增加输入框
    **/
    $(function () {

        //第一个发票票号"添加" 事件
        $("#addInput").click(function () {
            $("#JS_Dinvoice1").show();      //显示发票票号第二个输入框
            $("#addInput").hide();          //隐藏发票票号第一个"添加"
            $("#addInputfp1").show();       //显示发票票号第二个"添加"
        })
        //第二个发票票号"添加" 事件
        $("#addInputfp1").click(function () {
            $("#Js_Dinvoice2").show();      //显示发票票号第三个输入框
            $("#addInputfp1").hide();       //隐藏发票票号第二个"添加"
            $("#addInputfp2").show();       //显示发票票号第三个"添加"
        })

        //第三个发票票号"添加" 事件
        $("#addInputfp2").click(function () {
            $("#JS_Dinvoice3").show();      //显示发票票号第四个输入框
            $("#addInputfp2").hide();       //隐藏发票票号第三个"添加"
        })
    })
    $(function () {
        //第一个字轨票号"添加" 事件
        $("#addInput1").click(function () {
            $("#JS_Zigui1").show();         //显示字轨票号第二个输入框
            $("#addInput1").hide();          //隐藏字轨票号第一个"添加"
            $("#addInputzg1").show();       //显示字轨票号第二个"添加"
        })
        //第二个字轨票号"添加" 事件
        $("#addInputzg1").click(function () {
            $("#JS_Zigui2").show();        //显示字轨票号第三个输入框
            $("#addInputzg1").hide();       //隐藏字轨票号第二个"添加"
            $("#addInputzg2").show();       //显示字轨票号第三个"添加"
        })
        //第三个字轨票号"添加" 事件
        $("#addInputzg2").click(function () {
            $("#JS_Zigui3").show();         //显示字轨票号第四个输入框
            $("#addInputzg2").hide();       //隐藏字轨票号第三个"添加"
        })
    })
    /**
    * 刷新
    **/
    $(function () {
        $("#btnReplace").click(function () 
        {
            Replace();
        })
    })
    /**
      * 查询
    **/
    $(function () {
        $("#btnSearch").click(function () {
            LayerOpen('550px', '460px', '查询条件', $('#QueryModal'));//打开查询信息模态框          
        })
    })
    /**
  * 增加金三录入信息
  */
    $(function () {
        $("#btnAdd").click(function () {
            var checkId = CheckboxValueIDs();  //获取多选框的值 
            var AcceptanceTicketNumber = getTableCell(2);    //受理单号
            var NatPer_Name = getTableCell(3);    //纳税人姓名
            var Tenant_Name = getTableCell(4);    //付款方名称
            var Js_Id = getTableCell(1);   //审核管理ID
            var JsState = getTableCell(11); //受理状态         
            if (checkId.length == 0) {
                layer.msg("请选择要录入的受理单！");              
                return;
            }
            if (checkId.length > 1) {
                layer.msg("仅可选择一条受理单添加信息！");             
                return;
            }        
            if (JsState == "发票已出")
            {
                layer.msg("该受理单已缴税！");
                return;
            }
            if (JsState == "已销号") {
                layer.msg("该受理单已销号！");
                return;
            }           
            LayerOpen('850px', '580px', '添加', $('#AddModal')); //打开添加金三信息模态框
            //初始化发票票号
            $("#JS_Dinvoice1").hide();
            $("#Js_Dinvoice2").hide();
            $("#JS_Dinvoice3").hide();
            $("#addInputfp1").hide();
            $("#addInputfp2").hide();
            $("#addInput").show();
            //初始化字轨票号
            $("#JS_Zigui1").hide();
            $("#JS_Zigui2").hide();
            $("#JS_Zigui3").hide();
            $("#addInputzg1").hide();
            $("#addInputzg2").hide();
            $("#addInput1").show();

            $("#Js_Id").val(checkId[0]);
            $("#Ap_TicketNumber").val(AcceptanceTicketNumber);
            $("#N_Name").val(NatPer_Name);
            $("#T_Name").val(Tenant_Name); 
            $("#Js_Id").val(checkId[0]);
        })
    })
    /*
    **详细信息
     */
    $(function () {
        $("#btnFeesDetails").click(function () {
            
            var checkId = CheckboxValueIDs();  //获取多选框的值   
            var AcceptanceTicketNumber = getTableCell(2);    //受理单号
            var NatPerName = getTableCell(4);    //纳税人姓名 
            var TenantName = getTableCell(3);    //付款方名称
            var JsIncrement = (getTableCell(12)*0.01).toFixed(2);    //增值税
            var JsHouseTax = (getTableCell(13) * 0.01).toFixed(2);    //房产税
            var JsUrbanTax = (getTableCell(14) * 0.01).toFixed(2);    //城建税
            var JsEducation = (getTableCell(15) * 0.01).toFixed(2);    //教育附加税
            var JsLocalEducation = (getTableCell(16) * 0.01).toFixed(2);    //地方教育附加税
            var JsStamp = (getTableCell(17) * 0.01).toFixed(2);    //印花税
            var JsPersonTax = (getTableCell(18) * 0.01).toFixed(2);    //个人所得税
            var JsWaterTax = (getTableCell(19) * 0.01).toFixed(2);    //水利基金税
            var JsZigui = getTableCell(20);    //字轨票号
            var Dinvoice = getTableCell(21);    //发票票号
            var JsTax = getTableCell(8);    //开票金额
            if (checkId.length == 0) {
                layer.msg("请选择要查看的详细信息！");               
                return;
            }
            if (checkId.length > 1) {
                layer.msg("仅可选择一条信息查看！");               
                return;
            }
            LayerOpen('720px', '520px', '详细信息', $('#FeesDetailsModal')); //打开详细信息模态框            
            $("#JsId").val(checkId[0]);
            $("#AcceptanceTicketNumber").html(AcceptanceTicketNumber);
            $("#NatPerName").html(NatPerName);
            $("#TenantName").html(TenantName);
            $("#Increment").html(JsIncrement);
            $("#HouseTax").html(JsHouseTax);
            $("#UrbanTax").html(JsUrbanTax);
            $("#Education").html(JsEducation);
            $("#LocalEducation").html(JsLocalEducation);
            $("#Stamp").html(JsStamp);
            $("#PersonTax").html(JsPersonTax);
            $("#WaterTax").html(JsWaterTax);
            $("#Zigui").html(JsZigui);
            $("#Dinvoice").html(Dinvoice);
            $("#JsTax").html(JsTax);
        })
    })   
    /**
     *提交
     */
    $(function () {
        $("#btnSure").click(function () {         
            var Js_Increment = $("#Js_Increment").val(); //增值税
            if (Js_Increment == "") {
                layer.msg("增值税不能为空！", 0);
                return;
            }                    
            if (!Js_Increment.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("增值税输入有误,请输入到小数点后面两位！", 0);
                return;
            }
            
            var Js_HouseTax = $("#Js_HouseTax").val();//房产税
            if (Js_HouseTax == "") {
                layer.msg("房产税不能为空！", 0);
                return;
            }
            if (!Js_HouseTax.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("房产税输入有误,请输入到小数点后面两位！", 0);
                return;
            }

            var Js_UrbanTax = $("#Js_UrbanTax").val();//城建税
            if (Js_UrbanTax == "") {
                layer.msg("城建税不能为空！", 0);
                return;
            }
            if (!Js_UrbanTax.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("城建税输入有误,请输入到小数点后面两位！", 0);
                return;
            }

            var Js_Education = $("#Js_Education").val(); //教育附加税
            if ( Js_Education== "") {
                layer.msg("教育附加税不能为空！", 0);
                return;
            }
            if (!Js_Education.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("教育附加税输入有误,请输入到小数点后面两位！", 0);
                return;
            }

            var Js_LocalEducation =$("#Js_LocalEducation").val();//地方教育附加税 
            if (Js_LocalEducation == "") {
                layer.msg("地方教育附加税不能为空！", 0);
                return;
            }
            if (!Js_LocalEducation.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("地方教育附加税输入有误,请输入到小数点后面两位！", 0);
                return;
            }

            var Js_Stamp = $("#Js_Stamp").val();//印花税
            if (Js_Stamp == "") {
                layer.msg("印花税不能为空！", 0);
                return;
            }
            if (!Js_Stamp.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("印花税输入有误,请输入到小数点后面两位！", 0);
                return;
            }

            var Js_PersonTax =$("#Js_PersonTax").val();//个人所得税
            if (Js_PersonTax == "") {
                layer.msg("个人所得税不能为空！", 0);
                return;
            }
            if (!Js_PersonTax.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("个人所得税输入有误,请输入到小数点后面两位！", 0);
                return;
            }
            var Js_WaterTax = $("#Js_WaterTax").val();//水利基金
            if (Js_WaterTax == "") {
                layer.msg("水利基金税不能为空！", 0);
                return;
            }
            if (!Js_WaterTax.match(/^\d+(\.\d{2})?$/)) {
                layer.msg("水利基金输入有误,请输入到小数点后面两位！", 0);
                return;
            }
            if ($("#Js_Tax").val() == "") {
                layer.msg("开票金额不能为空！", 0);
                return;
            }
            if ($("#Js_CertificateNumber").val() == "") {
                layer.msg("完税证号不能为空！", 0);
                return;
            }
            if ($("#Js_Dinvoice").val() == "") {
                layer.msg("发票票号不能为空！", 0);
                return;
            }
            if ($("#Js_Zigui").val() == "") {
                layer.msg("字轨票号不能为空！", 0);
                return;
            }

            //设置开票金额input的值
               
            var JsData = GetWebControls(divfrom);
            ZorPostSimpleData("/Base/AddJinSan", JSON.stringify({ "jinsan": JsData }), function (data) {

                layer.msg(data.AnswerMeg, function () {
                    layer.closeAll();
                    Replace();
                });
            });
        })
    })

    /**自动计算税金*/
    function addJsTax()
    {
        var Js_Increment = $("#Js_Increment").val(); //增值税
        if (Js_Increment == "")
        {
            Js_Increment = 0;
        }
        var Js_HouseTax = $("#Js_HouseTax").val();//房产税
        if (Js_HouseTax == "") {
            Js_HouseTax = 0;
        }
        var Js_UrbanTax = $("#Js_UrbanTax").val();//城建税
        if (Js_UrbanTax == "") {
            Js_UrbanTax = 0;
        }
        var Js_Education = $("#Js_Education").val(); //教育附加税
        if (Js_Education == "") {
            Js_Education = 0;
        }
        var Js_LocalEducation = $("#Js_LocalEducation").val();//地方教育附加税 
        if (Js_LocalEducation == "") {
            Js_LocalEducation = 0;
        }
        var Js_Stamp = $("#Js_Stamp").val();//印花税
        if (Js_Stamp == "") {
            Js_Stamp = 0;
        }
        var Js_PersonTax = $("#Js_PersonTax").val();//个人所得税
        if (Js_PersonTax == "") {
            Js_PersonTax = 0;
        }
        var Js_WaterTax = $("#Js_WaterTax").val();//水利基金
        if (Js_WaterTax == "") {
            Js_WaterTax = 0;
        }
        var Js_Tax = parseFloat(parseFloat(Js_Increment) + parseFloat(Js_HouseTax) + parseFloat(Js_UrbanTax) + parseFloat(Js_Education) + parseFloat(Js_LocalEducation) + parseFloat(Js_Stamp) + parseFloat(Js_PersonTax) + parseFloat(Js_WaterTax)).toFixed(2);
        $("#Js_Tax").val(Js_Tax);
    }
</script>